package com.yunsom.testdemo.design.command;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Xbao
 * @description
 * @date 2022/6/7 16:22
 */
public class Broker {

  private List<Order> orderList = new ArrayList<>();

  public void takeOrder(Order order){
    orderList.add(order);
  }

  public void placeOrders(){
    for (Order order : orderList) {
      order.execute();
    }
    orderList.clear();
  }

}
